import axios from 'axios'

const baseURL = 'http://localhost:8123/api'

const api = axios.create({
  baseURL,
  timeout: 60000
})

export const createLoveMasterChat = (message, chatId) => {
  const url = `/ai/love_app/chat/sse_emitter?message=${encodeURIComponent(message)}&chatId=${chatId}`
  const eventSource = new EventSource(baseURL + url)
  return eventSource
}

export const createSuperAgentChat = (message) => {
  const url = `/ai/agent/chat?message=${encodeURIComponent(message)}`
  const eventSource = new EventSource(baseURL + url)
  return eventSource
}